<template>
  <div class="product">
    <img class="detail-image" v-for="(item, index) in imgList" :key="index" :src="item" alt="">
  </div>
</template>

<script>
import Product from '@/model/product'
export default {
  name: 'Product',
  data () {
    return {
      imgList: []
    }
  },
  async mounted () {
    const params = this.$route.params
    await this.getProduct(params.id)
  },
  methods: {
    async getProduct (id) {
      const res = await Product.getProduct(id)
      this.imgList = res.detail_image_list
      document.title = res.title
    }
  }
}
</script>

<style lang="stylus" scoped>
.detail-image{
  width: 100%;
}
</style>
